﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OneMG.Phoenix.Service.Model;
using OneMG.Phoenix.Service.Contracts;
using OneMG.Phoenix.Service;


namespace OneMG.Phoenix.AdminSite.Views.New
{
    public partial class Edit : System.Web.UI.Page
    {
        INewsService INews = new NewsService();
        ICategoryService ICategory = new CategoryService();

        public NewsModel objNews;

        public IList<CategoryModel> CategoryList = new List<CategoryModel>();

        public int newsID;



        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

               CategoryList= ICategory.GetByParentID(1);

                if (!string.IsNullOrEmpty(Request.QueryString["nid"]))
                {
                    newsID = int.Parse(Request.QueryString["nid"]);

                    objNews = INews.GetByNewsID(newsID);
                }
            }

        }
    }
}
